package classPractice;

public class Practice2 {
    private int id;
    private String name;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Practice2(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public Practice2() {
    }

    @Override
    public boolean equals(Object obj) {
        if(null == obj){
            return false;
        }
        if(this == obj){
            return true;
        }
        if(obj instanceof Practice2){
            Practice2 ts = (Practice2) obj;
            return this.getId() == ts.getId();
        }
        return false;
    }

    @Override
    public int hashCode() {

        return super.hashCode();
    }

    @Override
    public String toString() {
        return "Practice2{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
